const path = require('path')
const resolve = dir => {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  chainWebpack: config => {
    config.resolve.alias
      .set('_c', resolve('src/components')) // key,value自行定义，比如.set('@@', resolve('src/components'))
  },

  configureWebpack: config => {
    //调试JS
    config.devtool = "source-map";
  },

  devServer: {
    proxy: {
      '/api': {
        target: 'http://10.17.85.5', //要访问的跨域的域名
        ws: true,
        secure:false, // 使用的是http协议则设置为false，https协议则设置为true
        changOrigin: true, //开启代理
        pathRewrite: {'^/api' : '/api'}
      }
    }
  }
}